home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Libris Britannia 4
/
science library(b).zip
/
science library(b)
/
PROGRAMM
/
ASSEMBLE
/
0572.ZIP
/
CT.SHA
< prev
next >
Wrap
Text File
|
1987-04-21
|
1KB
|
50 lines
#! /bin/csh -f
# call a terminal, run setuid to root, executable from group tippers
set path=(/bin /usr/bin /usr/ucb /etc)
setenv PATH /bin:/usr/bin:/usr/ucb:/etc
onintr -
echo " Calling $1 at `date` ($$)" >>/usr/spool/uucp/LOGFILE
set status=0
csh -f <<-EOF-
set noclobber
cat /dev/null >/usr/spool/uucp/LCK..ttyi1
-EOF-
if ($status == 0) then
ed /etc/ttys <<DONE1
/ttyi1/s/0f/1f/
w
q
DONE1
sleep 1
kill -1 1
sleep 1
#DEC DF03 modem only
echo "$1" >/dev/ttyi1
sleep 180
set HERE=`w | grep -c ttyi1`
if ($HERE) then
echo " Call to $1 succeeded ($$)" >>/usr/spool/uucp/LOGFILE
else
echo " Call to $1 failed ($$)" >>/usr/spool/uucp/LOGFILE
endif
while ($HERE)
sleep 180
set HERE=`w | grep -c ttyi1`
end
sleep 1
ed /etc/ttys <<DONE2
/ttyi1/s/1f/0f/
w
q
DONE2
sleep 1
kill -1 1
sleep 1
chown uucp /dev/ttyi1
chmod 660 /dev/ttyi1
#chgrp daemon /dev/ttyi1
rm /usr/spool/uucp/LCK..ttyi1
echo " Call to $1 done at `date` ($$)" >>/usr/spool/uucp/LOGFILE
else
echo " But the dialer is LOCKED ($$)" >>/usr/spool/uucp/LOGFILE
endif